﻿package utils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

/**
 * 内部使用ArrayList的版本
 * @author zhrb
 *
 */
public class StudenDaoListImpl implements StudentDao {

	private List<Student> students = new ArrayList<Student>();
	
	@Override
	public Student readStudent(String name) {
		Student temp = null;
		for(Student e:students){
			if(e.getName().equals(name)){
				temp = e;
			}
		}
		return temp;
	}

	@Override
	public boolean writeStudent(Student student) {
		students.add(student);
		return true;
		
	}
	
	@Override
	public void diplayAllStudent(){
		for(Student e:students){
			if (e != null)
				System.out.println(e);
		}
	}

	@Override
	public List<Student> getAllStudents() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int add(Student stu) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(int sid) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(Student stu) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<Student> findAll() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Student findById(int sid) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Student findByName(String name) {
		// TODO Auto-generated method stub
		return null;
	}
	

}
